home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / DINKDEMO / DC_SCRIB / DSCRIBBL.C2 < prev    next >
Text File  |  1992-07-23  |  939b  |  46 lines

  1. /*
  2.     File:        DScribbleApp.c
  3.  
  4.     Written by:    Mark Gross
  5.  
  6.     Copyright:    ⌐ 1992 by Applied Technical Software, all rights reserved.
  7.     Use at your own risk.
  8.  
  9. */
  10. //This is the class deffinition of the DScribbleApplication
  11.  
  12. #include "DScribbleApp.h"
  13. #include "DScribbleDoc.h"
  14.  
  15.  
  16. DDocument* DScribbleApp :: MakeDDoc(Boolean OpenFromFile)
  17. {
  18.     DScribbleDoc *New;
  19.     
  20.     New = new DScribbleDoc;
  21.  
  22.             // if OpenFromFile == FALSE then it will 
  23.             // not read from any file
  24.     if(New->Init(OpenFromFile)) 
  25.     {
  26.         if ( fTarget = New->MakeWindow(FALSE) )
  27.             ((DWindow *) fTarget)->SetWindowTitle();// everything went ok, so set the title
  28.                 // I'm having the App tell 
  29.                 // the doc to make the window because I don't 
  30.                 // like haveing one init function do too much stuff.  
  31.                 // Its a reliability thing. BTW FALSE is for no collorQD
  32.         else
  33.             fTarget = New; // window not created
  34.     }
  35.     else
  36.     {
  37.         fTarget = this;
  38.         SelectWindow( FrontWindow());
  39.     }
  40.     return New;
  41. }
  42.  
  43.  
  44.  
  45.  
  46.